package myapp.shape;

import java.util.Scanner;

public class MyShape {
    public static void main(String[] args) {
        System.out.print("请输入圆的半径：");
        Scanner scanner = new Scanner(System.in);
        try {
            double r = scanner.nextDouble();
            Shape shape = new Shape(r);
            String tmp = "";
            if (r < 5) {
                tmp = "半径为：" + shape.getRadium() + "（cm）的圆，其面积为：" + shape.getArea(shape.getRadium()) + "（cm平方）";
                System.out.println(tmp);
            } else {
                tmp = "半径为：" + shape.getRadium() + "（cm）的圆，其周长为：" + shape.getCircum(shape.getRadium()) + "（cm）";
                System.out.println(tmp);
            }
            new SaveResult().saveResult(tmp);
        } catch (java.util.InputMismatchException e) {
            System.out.println("您输入的不是数字！注意：命令行后请输入数字！！！！");
        }catch (java.util.EmptyStackException s){
            System.out.println("您没有输入！注意：命令行后请输入内容！");
        }
    }
}
